package com.weige.conver.service;

import com.alibaba.fastjson.JSONObject;
import com.weige.conver.utils.DateUtils;
import com.weige.conver.utils.JsonUtils;
import com.weige.conver.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;

@Service
public class SigService {

    @Autowired
    RedisUtils redisUtils;

    public String addSigId(String deviceId) throws IOException {
        String sigId = DateUtils.getCurrentTime();
        redisUtils.setByHash("sigList", deviceId, JSONObject.toJSONString(sigId));
        return sigId;
    }
}
